﻿using System.Xml.Linq;
using NJabber.Stream.Elements;
using NUnit.Framework;

namespace NJabber.Stream.Elements
{
    [TestFixture]
    public class StreamErrorTest : ErrorElementTestBase
    {
        private string errorName = "stream-error";
        private string errorDescription = "Stream error description";
        private string errorDescriptionLang = "ln";

        public StreamErrorTest() : base(XmppNamespaces.StreamError, "stream", XmppNamespaces.Streams)
        { }

        [Test]
        public void Write_NotEmptyErrorNameAndDescription_WritesCorrectXml()
        {
            StreamError element = new StreamError(errorName, errorDescription, errorDescriptionLang);
            XElement expectedElement = CreateErrorXElement(errorName, errorDescription, errorDescriptionLang);
            VerifyWriteOutput(expectedElement, element);
        }
    }
}
